package objects;
import java.awt.image.BufferedImage;


public class Finder extends Thread{
		static int no = 1;
		BufferedImage img;
		Partition p;
		MyShapeBuffers ms;
		int noFinder;
		Finder(BufferedImage img, Partition p, MyShapeBuffers ms, int noFinder) {
			this.img = img;
			this.p = p;
			this.ms = ms;
			this.noFinder = noFinder;
		}
	    public void run() {
	    	System.out.println("Startuje watek" + no++);
	    	SimpleObject so = new SimpleObject(this.img, this.p,ms); 
	    	if (so.init()) {
	    		switch (noFinder){
	    			case 1 : ms.setFlagF1(false); break;
	    			case 2 : ms.setFlagF2(false); break;
	    			case 3 : ms.setFlagF3(false); break;
	    			case 4 : ms.setFlagF4(false); break;
	    		}	    		
	    	}
	    	this.interrupt();
	    }
	
}
